1. Field of the Invention
The present invention relates to a tracking apparatus for tracking a target object, a tracking method, and a computer-readable storage medium.
2. Description of the Related Art
An image capturing apparatus (for example, a digital camera) which captures a still image and moving image includes a tracking function of tracking (searching) an arbitrary target object. Such a tracking function is implemented using, for example, a pattern matching method, a relative difference method, or a color/luminance matching method. The pattern matching method searches an image to be captured for, as a target object, a region having a high matching degree with a template image stored in a storage unit or that which is updated as needed in a tracking mode. The relative difference method searches for a target object from an image difference between the current and previous frames. The color/luminance matching method searches an image to be captured for, as a target object, a region having a high matching degree with one or a plurality of colors, luminance levels, or histograms extracted from a target object.
The pattern matching method can attain a high-precision tracking performance when a target object does not move. However, the pattern matching method cannot attain a sufficient tracking performance when a target object moves (a change in distance between the target object and image capturing apparatus, a rotation of the target object, a change in orientation of the image capturing apparatus, etc.) The relative difference method fails to track a target object when another object passes between the target object and image capturing apparatus or when the target object frames in after it completely frames out. The color/luminance matching method can support a motion of a target object to some extent. However, the color/luminance matching method is not precise in specifying a target object based only on colors and luminance levels of the target object, and cannot attain sufficient tracking performance when a background includes many colors and luminance levels similar to those of the target object.
To solve such problems, Japanese Patent Laid-Open Nos. 5-284411 and 2010-28608 have proposed techniques to enhance tracking performance. Japanese Patent Laid-Open Nos. 5-284411 and 2010-28608 disclose techniques associated with extraction of features of a target object. With the technique of Japanese Patent Laid-Open No. 5-284411, a color (color signal) which most frequently appears in a region including a target object to be tracked is selected as a feature color of the target object. With the technique of Japanese Patent Laid-Open No. 2010-28608, upon extraction of a color of a target object to be tracked, a color which most frequently appears in a region including the target object and does not frequently appear in a background is preferentially selected as a feature color of the target object.
However, when the color which most frequently appears in the region including the target object is selected as the feature color, a background color included in that region is likely to be selected as the feature color, and an object which is different from the user's intention may be tracked (that is, a tracking error may occur). A color with low percentages of appearance in the region including the target object is likely to be an important color which represents a feature of the target object, but it is not selected as the feature color and is excluded. However, when the color with the low percentages of appearance in the region including the target object is simply selected as a feature color, the target object fails to be tracked when the feature color comes and goes due to a change of a surrounding environment or the target object. Also, a tracking error may occur when the same color as the feature color is included in another object other than the target object.